package com.mihe.core.excption;


import com.mihe.core.constant.IResponseEnum;

import java.text.MessageFormat;

/**
 * 业务异常断言
 *
 * @author Administrator
 */
public interface BusinessExceptionAssert extends IResponseEnum, Assert {

    @Override
    default BaseException newException(Object... args) {
        String msg = MessageFormat.format(this.getMessage(), args);

        return new BusinessException(this);
    }

    @Override
    default BaseException newException(Throwable t, Object... args) {
        String msg = MessageFormat.format(this.getMessage(), args);

        return new BusinessException(this, msg, t);
    }
}
